#ifndef __COMCON__
#define __COMCON__

#include <unordered_map>
#include <sstream>
#include "MapFunc.h"
#include "Compare.h"

class CompareController {
    private:
        std::unordered_map<std::string,Compare*> compareMap;
        Compare* addCompare(std::string _id,std::string _stuId,std::string _carId);
    public:
        CompareController();
        ~CompareController();
        Compare* addCompare(Student* stu,SmartCar* car);
        int getCompareCount();
        void listAllCompare(Compare* (&compareList)[]);
        int getCompareCountByCarId(std::string carId);
        void findCompareByCarId(std::string carId,Compare* (&compareList)[]);
        bool deleteCompare(std::string _id);
        bool deleteCompare(Compare* _compare);
        Compare* strToCompare(std::istringstream &iss);
};

#endif